import React, { Component } from 'react'
import './index.css';
export default class Video extends Component {
    state = {
        src: 'http://api.xiaohigh.com:8090/video/random'
    }

    render() {
        //获取组件标签的 src 属性值
        return (
            <div className="video-container" onClick={this.change}>
                <video controls src={this.state.src}></video>
            </div>
        )
    }
    
    change = () => {
        this.setState({
            src: 'http://api.xiaohigh.com:8090/video/random?t='+Date.now()
        })
    }
}
